package appSocket

import "fmt"

const TypePing = 0x60       //心跳消息
const TypeAuth = 0x66       //认证消息
const TypeAuthErr = 0x67    //认证失败
const TypeOtherLogin = 0x68 //其他账号登陆

type socketMessage struct {
	Type     int         `json:"type"`     //消息类型
	Data     interface{} `json:"data"`     //消息内容
	DebugMsg string      `json:"debugMsg"` //调试消息
}

func NewSocketMessage(messageType int, data interface{}) *socketMessage {
	return &socketMessage{
		Type: messageType,
		Data: data,
	}
}
func (sm socketMessage) String() string {
	return fmt.Sprintf("type:%d,data:%s", sm.Type, sm.Data)
}
